package com.tj.admin.auth.config;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2019-11-25
 * Time: 13:10
 */

@Component
public class ApolloConfigUtil {


    @NacosValue(value = "${server.test:false}", autoRefreshed = true)
    private boolean isServerTest;

    public boolean isServerTest() {
        return isServerTest;
    }

    @NacosValue(value = "${login.white.list:default}", autoRefreshed = true)
    private String inWhiteList;

    public String inWhiteList() {
        return inWhiteList;
    }

    @NacosValue(value = "${oss.public.endpoint:default}", autoRefreshed = true)
    private String getOssPublicEndPoint;

    public String getOssPublicEndPoint() {
        return getOssPublicEndPoint;
    }

    @NacosValue(value = "${oss.private.accessKeyId:default}", autoRefreshed = true)
    private String getPirvateAccessKeyId;

    public String getPirvateAccessKeyId() {
        return getPirvateAccessKeyId;
    }


    @NacosValue(value = "${oss.private.accessKeySecret:default}", autoRefreshed = true)
    private String getPrivateAccessKeySecret;

    public String getPrivateAccessKeySecret() {
        return getPrivateAccessKeySecret;
    }


    @NacosValue(value = "${oss.sts.domain:default}", autoRefreshed = true)
    private String getStsDomain;

    public String getStsDomain() {
        return getStsDomain;
    }


    @NacosValue(value = "${oss.RoleArn:default}", autoRefreshed = true)
    private String getAccessRoleArn;

    public String getAccessRoleArn() {
        return getAccessRoleArn;
    }


    @NacosValue(value = "${oss.qsyq.base.url:}", autoRefreshed = true)
    private String getQsyqBaseUrl;

    public String getQsyqBaseUrl() {
        return ossBaseUrl;
    }


    @NacosValue(value = "${amazon.s3.accessKeyId:}", autoRefreshed = true)
    private String getAmazonAccessKeyId;

    public String getAmazonAccessKeyId() {
        return getAmazonAccessKeyId;
    }


    @NacosValue(value = "${amazon.s3.accessKeySecret:}", autoRefreshed = true)
    private String getAmazonAccessKeySecret;

    public String getAmazonAccessKeySecret() {
        return getAmazonAccessKeySecret;
    }


    @NacosValue(value = "${amazon.s3.base.url:}", autoRefreshed = true)
    private String getAmazonS3BaseUrl;

    public String getAmazonS3BaseUrl() {
        return getAmazonS3BaseUrl;
    }


    @NacosValue(value = "${amazon.s3.region:ap-south-1}", autoRefreshed = true)
    private String getAmazonRegion;

    public String getAmazonRegion() {
        return getAmazonRegion;
    }


    @NacosValue(value = "${amazon.s3.RoleArn:arn:aws:iam::455424942799:role/AssumeRole}", autoRefreshed = true)
    private String getAmazonAccessRoleArn;

    public String getAmazonAccessRoleArn() {
        return getAmazonAccessRoleArn;
    }


    @NacosValue(value = "${amazon.s3.bucketName:}", autoRefreshed = true)
    private String getAmazonBucketName;

    public String getAmazonBucketName() {
        return getAmazonBucketName;
    }


    @NacosValue(value = "${oss.bucketName:}", autoRefreshed = true)
    private String getBucketName;

    public String getBucketName() {
        return getBucketName;
    }

    @NacosValue(value = "${oss.baseUrl:}", autoRefreshed = true)
    private String ossBaseUrl;

    public String getOssBaseUrl() {
        return ossBaseUrl;
    }


    @NacosValue(value = "${api.web.path:}", autoRefreshed = true)
    private String getApiWebPath;

    public String getApiWebPath() {
        return getApiWebPath;
    }


    //========================APP升级相关配置 start========================//

    @NacosValue(value = "${app.ruleCode:}", autoRefreshed = true)
    private String getRuleCode;

    public String getRuleCode() {
        return getRuleCode;
    }

    /**
     * 升级描述
     *
     * @return
     */

    @NacosValue(value = "${app.forceUpdate.desc:}", autoRefreshed = true)
    private String getForceUpdateDesc;

    public String getForceUpdateDesc() {
        return getForceUpdateDesc;
    }


    @NacosValue(value = "${app.forceUpdate.desc.layout:1}", autoRefreshed = true)
    private Integer getForceUpdateDescLayout;

    public Integer getForceUpdateDescLayout() {
        return getForceUpdateDescLayout;
    }


    /**
     * ios需要升级的 最低版本
     *
     * @return
     */

    @NacosValue(value = "${app.forceUpdate.iosMinVersionCode:0}", autoRefreshed = true)
    private Integer getIosMinVersionCode;

    public int getIosMinVersionCode() {
        return getIosMinVersionCode;
    }

    /**
     * ios apk update url
     *
     * @return
     */

    @NacosValue(value = "${app.forceUpdate.iosUrl:}", autoRefreshed = true)
    private String getForceUpdateIosUrl;

    public String getForceUpdateIosUrl() {
        return getForceUpdateIosUrl;
    }


    /**
     * android apk update url
     *
     * @return
     */

    @NacosValue(value = "${app.forceUpdate.androidUrl:}", autoRefreshed = true)
    private String getForceUpdateAndroidUrl;

    public String getForceUpdateAndroidUrl() {
        return getForceUpdateAndroidUrl;
    }

    //========================APP升级相关配置 end========================//


    @NacosValue(value = "${api.active.switch:false}", autoRefreshed = true)
    private boolean getApiSwitch;

    public Boolean getApiSwitch() {
        return getApiSwitch;
    }

    @NacosValue(value = "${contract.url.sync.switch:false}", autoRefreshed = true)
    private boolean contractUrlSyncSwitch;

    public Boolean contractUrlSyncSwitch() {
        return contractUrlSyncSwitch;
    }


    @NacosValue(value = "${product.detail.sync.switch:false}", autoRefreshed = true)
    private boolean productDetailSyncSwitch;

    public Boolean productDetailSyncSwitch() {
        return productDetailSyncSwitch;
    }


    @NacosValue(value = "${check.merchant.switch:false}", autoRefreshed = true)
    private boolean getMerchantCheckSwitch;

    public Boolean getMerchantCheckSwitch() {
        return getMerchantCheckSwitch;
    }

    @NacosValue(value = "${api.switch.msg:System upgrade, please come back in 2 hours.}", autoRefreshed = true)
    private String getApiSwitchMsg;

    public String getApiSwitchMsg() {
        return getApiSwitchMsg;
    }

    /**
     * Aadhaar advance.ai AccessKey
     *
     * @return
     */

    @NacosValue(value = "${advance.ai.accessKey:e9a9e619d9855b3a}", autoRefreshed = true)
    private String getAadhaarAdvanceAiAccessKey;

    public String getAadhaarAdvanceAiAccessKey() {
        return getAadhaarAdvanceAiAccessKey;
    }

    /**
     * 风控路径
     */

    @NacosValue(value = "${risk.base.url:http://172.90.15.50:8080}", autoRefreshed = true)
    private String getRiskBaseUrl;

    public String getRiskBaseUrl() {
        return getRiskBaseUrl;
    }


    @NacosValue(value = "${cashmama.admin.url:https://admin-api.cashmama.in}", autoRefreshed = true)
    private String getCashmamaAdminUrl;

    public String getCashmamaAdminUrl() {
        return getCashmamaAdminUrl;
    }


    /**
     * 初始等级
     */

    @NacosValue(value = "${initialization.risklevel:1}", autoRefreshed = true)
    private Integer getInitializationRiskLevel;

    public Integer getInitializationRiskLevel() {
        return getInitializationRiskLevel;
    }

    /**
     * 获取产品详情提示
     *
     * @return
     */

    @NacosValue(value = "${product.detail.tips:Pay your bills on time and raise amount quickly}", autoRefreshed = true)
    private String getProductDetailTips;

    public String getProductDetailTips() {
        return getProductDetailTips;
    }


    @NacosValue(value = "${register.sms.provider.name:gcarde}", autoRefreshed = true)
    private String smsProviderName;

    public String getSmsProviderName() {
        return smsProviderName;
    }


    @NacosValue(value = "${gcard.domain:http://msg.infin8linx.com/sms/send}", autoRefreshed = true)
    private String gcardeDomail;

    public String getGcardeDomail() {
        return gcardeDomail;
    }


    @NacosValue(value = "${gcard.account:no}", autoRefreshed = true)
    private String gcardeAccount;

    public String getGcardeAccount() {
        return gcardeAccount;
    }

    @NacosValue(value = "${gcard.password:no}", autoRefreshed = true)
    private String gcardePassword;

    public String getGcardePassword() {
        return gcardePassword;
    }


    /**
     * 借款协议预览
     *
     * @return
     */

    @NacosValue(value = "${loan.agreement.url:https://cashzone.s3.ap-south-1.amazonaws.com/app/LoanAgreements.html}", autoRefreshed = true)
    private String getLoanAgreementsUrl;

    public String getLoanAgreementsUrl() {
        return getLoanAgreementsUrl;
    }


    @NacosValue(value = "${check.aadhaar:true}", autoRefreshed = true)
    private boolean openCheckAadhaar;

    public boolean openCheckAadhaar() {
        return openCheckAadhaar;
    }

    /**
     * 是否开启 api的ocr识别 --new version
     */

    @NacosValue(value = "${open.api.ocr:true}", autoRefreshed = true)
    private boolean openApiOcr;

    public boolean openApiOcr() {
        return openApiOcr;
    }


    @NacosValue(value = "${deepfinch.appid:f2771b680dfe44e3b2b70863968c7f6a}", autoRefreshed = true)
    private String getDeepFinchAppId;

    public String getDeepFinchAppId() {
        return getDeepFinchAppId;
    }


    @NacosValue(value = "${deepfinch.appsecret:34b379d4aae1459ca1da39ff70cf57cd}", autoRefreshed = true)
    private String getDeepFinchAppSecret;

    public String getDeepFinchAppSecret() {
        return getDeepFinchAppSecret;
    }


    /**
     * ocr 识别panCard 图片不清晰 时候的提示
     */


    @NacosValue(value = "${pan.card.ocr.tip:Please take photos at a slightly longer distance for clear pancard photo}", autoRefreshed = true)
    private String getPanCardOcrTip;

    public String getPanCardOcrTip() {
        return getPanCardOcrTip;
    }


    @NacosValue(value = "${razorpay.limit:oneCashAll}", autoRefreshed = true)
    private String razorPayLimit;

    public String razorPayLimit() {
        return razorPayLimit;
    }

    /**
     * 需要查询上一笔还款订单状态
     */

    @NacosValue(value = "${need.query.last.repayment.order.status:true}", autoRefreshed = true)
    private boolean needQueryLastRepaymentOrderStatus;

    public boolean needQueryLastRepaymentOrderStatus() {
        return needQueryLastRepaymentOrderStatus;
    }

    /**
     * app 还款完成后跳转地址
     *
     * @return
     */

    @NacosValue(value = "${app.repayment.return.url:https://securegw.paytm.in/theia/paytmCallback}", autoRefreshed = true)
    private String getAppRepaymentReturnUrl;

    public String getAppRepaymentReturnUrl() {
        return getAppRepaymentReturnUrl;
    }

    /**
     * 还款 redis锁时间 单位秒
     */

    @NacosValue(value = "${repayment.redis.expire.seconds:3600}", autoRefreshed = true)
    private int getRepaymentRedisExpireSeconds;

    public int getRepaymentRedisExpireSeconds() {
        return getRepaymentRedisExpireSeconds;
    }

    /**
     * 获取权限
     *
     * @return
     */

    @NacosValue(value = "${app.permissions.tips:{ \"tips\": \"We need to access the following information to check credit eligibility.\", \"permissions\": [ \"Contacts\", \"Device Information\", \"SMS\" ] }\t}", autoRefreshed = true)
    private String getPermissions;

    public String getPermissions() {
        return getPermissions;
    }


    @NacosValue(value = "${app.permissions.tips.switch:true}", autoRefreshed = true)
    private Boolean getPermissionsSwitch;

    public Boolean getPermissionsSwitch() {
        return getPermissionsSwitch;
    }


    @NacosValue(value = "${sms.app.permissions.tips:}", autoRefreshed = true)
    private String getPermissionsOfSms;

    public String getPermissionsOfSms() {
        return getPermissionsOfSms;
    }

    /**
     * 广告位列表
     *
     * @return
     */

    @NacosValue(value = "${advertises.list:}", autoRefreshed = true)
    private String getAdvertises;

    public String getAdvertises() {
        return getAdvertises;
    }

    /**
     * ALGO360认证全局开关
     *
     * @return
     */

    @NacosValue(value = "${need.algo360.verify:false}", autoRefreshed = true)
    private Boolean needALGO360Verify;

    public boolean needALGO360Verify() {
        return needALGO360Verify;
    }

    /**
     * 订单algo360开关
     *
     * @return
     */

    @NacosValue(value = "${order.algo360.verify:false}", autoRefreshed = true)
    private Boolean orderALGO360Verify;

    public boolean orderALGO360Verify() {
        return orderALGO360Verify;
    }

    /**
     * 官网产品列表
     *
     * @return
     */

    @NacosValue(value = "${website.product.list:}", autoRefreshed = true)
    private String getWebSiteProductList;

    public String getWebSiteProductList() {
        return getWebSiteProductList;
    }


    @NacosValue(value = "${credit.amount:10,000}", autoRefreshed = true)
    private String getCreditAmount;

    public String getCreditAmount() {
        return getCreditAmount;
    }

    /**
     * mock highmark body
     *
     * @return
     */

    @NacosValue(value = "${test.mock.highmark.body:}", autoRefreshed = true)
    private String getMockHighmarkBody;

    public String getMockHighmarkBody() {
        return getMockHighmarkBody;
    }

    /**
     * mock highmark body
     *
     * @return
     */

    @NacosValue(value = "${highmark.config:}", autoRefreshed = true)
    private String getHighmarkConfig;

    public JSONObject getHighmarkConfig() {
        String tmp = getHighmarkConfig;
        if (StringUtils.isEmpty(tmp)) {
            return new JSONObject();
        }
        return JSON.parseObject(tmp);
    }


    @NacosValue(value = "${highmark.question.page.user:}", autoRefreshed = true)
    private String getHighmarkQuestionPageUserList;

    public String getHighmarkQuestionPageUserList() {
        return getHighmarkQuestionPageUserList;
    }


    @NacosValue(value = "${highmark.question.page.result:}", autoRefreshed = true)
    private String getHighmarkQuestionPageResult;

    public String getHighmarkQuestionPageResult() {
        return getHighmarkQuestionPageResult;
    }


    @NacosValue(value = "${algo360.client.id:EJXO9DsSbkqVjd2Muy4ztMgRAkMgzblHjzDgEopN}", autoRefreshed = true)
    private String getAlogo360ClientId;

    public String getAlogo360ClientId() {
        return getAlogo360ClientId;
    }


    @NacosValue(value = "${algo360.client.secret:jL1F89yTLelqo8PKxEResiEtdbl9QU0oLf2kGDz53QOWPJt62t8AqMQ812cWB4skBq1ylX1dPFkC0MhzvS9WnJDMGVnv4tAme5akDPXFRHKGpeJxqvQ4h7nPRd3OJ7UU}", autoRefreshed = true)
    private String getAlogo360ClientSecret;

    public String getAlogo360ClientSecret() {
        return getAlogo360ClientSecret;
    }


    @NacosValue(value = "${algo360.refresh.token:EVk3M9lFNVYiH47cpi6TYXdVkLL96I}", autoRefreshed = true)
    private String getAlogo360RefreshToken;

    public String getAlogo360RefreshToken() {
        return getAlogo360RefreshToken;
    }


    @NacosValue(value = "${algo360.domain.url:}", autoRefreshed = true)
    private String getAlgo360Domain;

    public String getAlgo360Domain() {
        return getAlgo360Domain;
    }

    /**
     * 反欺诈分数阈值
     * hack score阈值为0.98，由行业⼤大数据训练得到，⼤大于0.98是hack⾏行行为，⼩小于等于 0.98是正常活⼈人
     */

    @NacosValue(value = "${hack.score.threshold:0.98}", autoRefreshed = true)
    private Double getHackScoreThreshold;

    public Double getHackScoreThreshold() {
        return getHackScoreThreshold;
    }


    @NacosValue(value = "${bank.confirm.tips:Please confirm your payment account.It can be modified after placing the order}", autoRefreshed = true)
    private String getBankConfirmTips;

    public String getBankConfirmTips() {
        return getBankConfirmTips;
    }


    @NacosValue(value = "${check.ifsc.bank.name:false}", autoRefreshed = true)
    private Boolean checkIfscBankName;

    public boolean checkIfscBankName() {
        return checkIfscBankName;
    }


    @NacosValue(value = "${permit.14days.order:false}", autoRefreshed = true)
    private Boolean permit14DaysOrder;

    public boolean permit14DaysOrder() {
        return permit14DaysOrder;
    }


    @NacosValue(value = "${one.day.one.order:true}", autoRefreshed = true)
    private Boolean oneDayOneOrderInProductCategory;

    public boolean oneDayOneOrderInProductCategory() {
        return oneDayOneOrderInProductCategory;
    }


    @NacosValue(value = "${permit.yes.bank.bind:false}", autoRefreshed = true)
    private Boolean permitYesBankBind;

    public boolean permitYesBankBind() {
        return permitYesBankBind;
    }

    /**
     * 新客是否允许下单
     */

    @NacosValue(value = "${newuser.pushorder.allow:true}", autoRefreshed = true)
    private Boolean isNewUserPushOrderAllow;

    public boolean isNewUserPushOrderAllow() {
        return isNewUserPushOrderAllow;
    }


    /**
     * 根据app判断是否允许新客下单
     *
     * @param packageName
     * @return
     */

//    @NacosValue(value = "${newuser.pushorder.allow:true}", autoRefreshed = true)
//    private Boolean  isNewUserPushOrderAllow;
    public boolean permitOrderForNewUser(String packageName) {
//        String key = String.format("%s.permit.order", packageName);
        return true;
    }

    /**
     * 指定包名所有用户不能下单
     *
     * @param packageName
     * @return
     */
    public boolean permitOrderForAll(String packageName) {
//        String key = String.format("%s.all.permit.order", packageName);
//        return config.getBooleanProperty(key, true);
        return true;
    }

    /**
     * 是否允许下单
     *
     * @return
     */

    @NacosValue(value = "${permit.order:true}", autoRefreshed = true)
    private Boolean permitOrder;

    public boolean permitOrder() {
        return permitOrder;
    }


    @NacosValue(value = "${audit.mobiles:}", autoRefreshed = true)
    private String auditMobiles;

    public List<String> auditMobiles() {
        String str = auditMobiles;
        if (StringUtils.isEmpty(str)) {
            return new ArrayList<>();
        }
        return Lists.newArrayList(str.split(","));
    }


    /**
     * 不允许下单提示
     *
     * @return
     */

    @NacosValue(value = "${not.permit.order.tips:We regret for the inconvenience caused to you, due to Covid-19 currently we are not disbursing the loans, We will let you know once we started disbrusement. Thank you.}", autoRefreshed = true)
    private String notPermitOrderTips;

    public String notPermitOrderTips() {
        return notPermitOrderTips;
    }


    @NacosValue(value = "${permit.order.mobile:}", autoRefreshed = true)
    private String permitOrderUserMobile;

    public String permitOrderUserMobile() {
        return permitOrderUserMobile;
    }

    /**
     * 公告通知
     *
     * @return
     */

    @NacosValue(value = "${home.notice:}", autoRefreshed = true)
    private String getHomeNotice;

    public String getHomeNotice() {
        return getHomeNotice;
    }


    @NacosValue(value = "${show.razorpay:true}", autoRefreshed = true)
    private boolean showRazorpay;

    public boolean showRazorpay() {
        return showRazorpay;
    }


    @NacosValue(value = "${repay.msg.info:{\"title\":\"Repayment instructions\",\"msg\":\"Please do not transfer repayment to any individual's account. %s is not responsible for payments made to unofficial accounts.\",\"imgUrl\":\"https://dhanadhan.oss-ap-south-1.aliyuncs.com/imgs/notice.png\"}}", autoRefreshed = true)
    private String getRepayMsgInfo;

    public String getRepayMsgInfo() {
        return getRepayMsgInfo;
    }

    /**
     * 开启抵扣罚息
     *
     * @return
     */

    @NacosValue(value = "${deduct.penalty.interest.open:false}", autoRefreshed = true)
    private boolean deductPenaltyInterestOpen;

    public boolean deductPenaltyInterestOpen() {
        return deductPenaltyInterestOpen;
    }


    @NacosValue(value = "${extension.show:true}", autoRefreshed = true)
    private boolean showExtension;

    public boolean showExtension() {
        return showExtension;
    }

    @NacosValue(value = "${check.save.cardinfo.compare:false}", autoRefreshed = true)
    private boolean saveCardInfoCompare;

    public boolean saveCardInfoCompare() {
        return saveCardInfoCompare;
    }

    @NacosValue(value = "${trade.query.3d.sync:false}", autoRefreshed = true)
    private Boolean tradeQuery3dSync;

    public Boolean tradeQuery3dSync() {
        return tradeQuery3dSync;
    }


    @NacosValue(value = "${overdue.extension.days:7,45}", autoRefreshed = true)
    private String getExtensionOverdueDays;

    public List<String> getExtensionOverdueDays() {
        return Arrays.asList(getExtensionOverdueDays.split(","));
    }


    @NacosValue(value = "${extension.by.rate:15,60}", autoRefreshed = true)
    private String getExtensionByRate;

    public List<String> getExtensionByRate() {
        return Arrays.asList(getExtensionByRate.split(","));
    }


    @NacosValue(value = "${extension.by.fixed.fee:7,15}", autoRefreshed = true)
    private String getExtensionByFixedFee;

    public List<String> getExtensionByFixedFee() {
        return Arrays.asList(getExtensionByFixedFee.split(","));
    }


    @NacosValue(value = "${extension.tips:To help you through difficult times, we provide loan renewal services. After applying for an extension, no penalty will be charged until the end of the extension.}", autoRefreshed = true)
    private String getExtensionTips;

    public String getExtensionTips() {
        return getExtensionTips;
    }


    @NacosValue(value = "${extension.fee:200}", autoRefreshed = true)
    private String getExtensionFee;

    public String getExtensionFee() {
        return getExtensionFee;
    }


    @NacosValue(value = "${extension.fee.second.range:400}", autoRefreshed = true)
    private String getExtensionFeeSecondRange;

    public String getExtensionFeeSecondRange() {
        return getExtensionFeeSecondRange;
    }


    @NacosValue(value = "${extension.days:30}", autoRefreshed = true)
    private Integer getExtensionDays;

    public Integer getExtensionDays() {
        return getExtensionDays;
    }


    @NacosValue(value = "${extension.days.by.rate:60}", autoRefreshed = true)
    private Integer getExtensionDaysByRate;

    public Integer getExtensionDaysByRate() {
        return getExtensionDaysByRate;
    }


    @NacosValue(value = "${extension.count.limit:1}", autoRefreshed = true)
    private Integer getExtensionCountLimit;

    public Integer getExtensionCountLimit() {
        return getExtensionCountLimit;
    }


    @NacosValue(value = "${extension.notify.url:}", autoRefreshed = true)
    private String getExtensionNotifyUrl;

    public String getExtensionNotifyUrl() {
        return getExtensionNotifyUrl;
    }


    @NacosValue(value = "${ocr.active.merchant:advance}", autoRefreshed = true)
    private String getWhichOcrIsUsed;

    public String getWhichOcrIsUsed() {
        return getWhichOcrIsUsed;
    }


    @NacosValue(value = "${check.in.middle:{\"title\": \"Activity Description:\",\"descriptions\": [{\"tips\": \"1. Check in every day to get ₹ 1\",\"highlightText\": \"₹ 1\"},{\"tips\": \"2. Check in on Wednesday and Sunday to get double\",\"highlightText\": \"Wednesday and Sunday\"}]}}", autoRefreshed = true)
    private String getCheckInMiddleDes;

    public String getCheckInMiddleDes() {
        return getCheckInMiddleDes;
    }

    @NacosValue(value = "${check.in.bottom:{\n" +
            "    \"title\":\"Instructions for use:\",\n" +
            "    \"descriptions\":[\n" +
            "        {\n" +
            "            \"tips\":\"1.  Cash received can only be used in Cashbar.\",\n" +
            "            \"highlightText\":\"\"\n" +
            "        },\n" +
            "        {\n" +
            "            \"tips\":\" 2.  Cash received can be used for repayment.\",\n" +
            "            \"highlightText\":\"\"\n" +
            "        },\n" +
            "        {\n" +
            "            \"tips\":\" 3.  More usage scenarios will be available in the future.\",\n" +
            "            \"highlightText\":\"\"\n" +
            "        },\n" +
            "        {\n" +
            "            \"tips\":\" 4.  Cashbar has the right of final interpretation.\",\n" +
            "            \"highlightText\":\"\"\n" +
            "        }\n" +
            "    ]\n" +
            "}}", autoRefreshed = true)
    private String getCheckInBottomDes;

    public String getCheckInBottomDes() {
        return getCheckInBottomDes;
    }


    @NacosValue(value = "${social.login.open:true}", autoRefreshed = true)
    private boolean getSocialLoginOpen;

    public boolean getSocialLoginOpen() {
        return getSocialLoginOpen;
    }


    @NacosValue(value = "${face.hack.open:true}", autoRefreshed = true)
    private boolean faceHackOpen;

    public boolean faceHackOpen() {
        return faceHackOpen;
    }

    @NacosValue(value = "${advance.face.hack.open:true}", autoRefreshed = true)
    private boolean advanceFaceDetectionOpen;

    public boolean getAdvanceFaceDetectionOpen() {
        return advanceFaceDetectionOpen;
    }


    @NacosValue(value = "${permit.push.first.risk:true}", autoRefreshed = true)
    private boolean permitPushToFirstRisk;

    public boolean permitPushToFirstRisk() {
        return permitPushToFirstRisk;
    }


    @NacosValue(value = "${user.reject.tips:Sorry, you have not passed the eligibility check and cannot apply for a loan, you can reapply on %s}", autoRefreshed = true)
    private String rejectTips;

    public String rejectTips() {
        return rejectTips;
    }


    @NacosValue(value = "${user.reject.sec.tips:During this period, we provide you with many other loan platforms, you will have more opportunities.}", autoRefreshed = true)
    private String rejectSecTips;

    public String rejectSecTips() {
        return rejectSecTips;
    }


    @NacosValue(value = "${manual.risk.result:pass}", autoRefreshed = true)
    private String manualRiskResult;

    public String manualRiskResult() {
        return manualRiskResult;
    }


    @NacosValue(value = "${current.date.orders.number:100}", autoRefreshed = true)
    private Integer permitCountOrders;

    public Integer permitCountOrders() {
        return permitCountOrders;
    }


    @NacosValue(value = "${loan.zone.old.version.submit.open:true}", autoRefreshed = true)
    private boolean loanZoneOldVersionSubmitOpen;

    public boolean loanZoneOldVersionSubmitOpen() {
        return loanZoneOldVersionSubmitOpen;
    }


    @NacosValue(value = "${gps.open:false}", autoRefreshed = true)
    private boolean gpsOpen;

    public boolean gpsOpen() {
        return gpsOpen;
    }


    @NacosValue(value = "${permit.apply.time.range:00:00;24:00}", autoRefreshed = true)
    private String permitApplyTimeRange;

    public String permitApplyTimeRange() {
        return permitApplyTimeRange;
    }


    @NacosValue(value = "${use.razorpay.type:APP}", autoRefreshed = true)
    private String useRazorpayType;

    public String useRazorpayType() {
        return useRazorpayType;
    }


    @NacosValue(value = "${use.cashfree.type:WAP}", autoRefreshed = true)
    private String useCashFreeType;

    public String useCashFreeType() {
        return useCashFreeType;
    }


    @NacosValue(value = "${amazon.s3.storage.open:true}", autoRefreshed = true)
    private boolean openAmazonS3Storage;

    public boolean openAmazonS3Storage() {
        return openAmazonS3Storage;
    }


    @NacosValue(value = "${loanzone.app.menu.list.url:}", autoRefreshed = true)
    private String menuList;

    public String getMenuList() {
        return menuList;
    }

    @NacosValue(value = "${app.user.menu.info:{}}", autoRefreshed = true)
    private String userInfoMenu;

    public String getUserInfoMenu() {
        return userInfoMenu;
    }

    @NacosValue(value = "${pay.amount:300}", autoRefreshed = true)
    private String payAmount;

    public String getPayAmount() {
        return payAmount;
    }


    /**
     * 牛信短信配置
     */
    @NacosValue(value = "${nx.sms.url:no}", autoRefreshed = true)
    private String nxSmsUrl;

    public String getNxSmsUrl() {
        return nxSmsUrl;
    }

    @NacosValue(value = "${nx.sms.otp.appkey:no}", autoRefreshed = true)
    private String nxSmsOtpAppKey;

    public String getNxSmsOtpAppKey() {
        return nxSmsOtpAppKey;
    }


    @NacosValue(value = "${nx.sms.otp.secretkey:no}", autoRefreshed = true)
    private String nxSmsOtpSecretKey;

    public String getNxSmsOtpSecretKey() {
        return nxSmsOtpSecretKey;
    }

    @NacosValue(value = "${nx.sms.otp.sender:no}", autoRefreshed = true)
    private String nxSmsOtpSender;

    public String getNxSmsOtpSender() {
        return nxSmsOtpSender;
    }


    /**
     * 产品列表白名单
     */

    @NacosValue(value = "${white.usercode.v2:no}", autoRefreshed = true)
    private String whiteUserCodes;

    public String getWhiteUserCodes() {
        return whiteUserCodes;
    }

     @NacosValue(value = "${full.product.category:no}", autoRefreshed = true)
    private String fullProductCategory;

    public String getFullProductCategory() {
        return fullProductCategory;
    }



    @NacosValue(value = "${white.product.codes:no}", autoRefreshed = true)
    private String whiteProducts;

    public String getWhiteProducts() {
        return whiteProducts;
    }


    /**
     * 用户最大可申请次数
     */
    @NacosValue(value = "${user.max.apply.limit:3}", autoRefreshed = true)
    public Integer userMaxApplyLimit;

    public Integer getUserMaxApplyLimit(){
        return userMaxApplyLimit;
    }



    @NacosValue(value = "${sync.merchantCodes:no}", autoRefreshed = true)
    private String syncMerchantCodes;

    public String getSyncMerchantCodes() {
        return syncMerchantCodes;
    }

    @NacosValue(value = "${order.notice:}", autoRefreshed = true)
    private String orderNotice;

    public String getOrderNotice() {
        return orderNotice;
    }

    //"{"cashmama":1,"smartloan":2}"
    @NacosValue(value = "${productCategory.promotion.status.list:}", autoRefreshed = true)
    private String productCategoryPromotionStatusList;

    public Integer getProductCategoryPromotionStatusList(String productCategory) {
        if (!StringUtils.isEmpty(productCategoryPromotionStatusList)) {
            HashMap<String, String> map = JSON.parseObject(productCategoryPromotionStatusList, HashMap.class);
            for (String key : map.keySet()) {
                String value = map.get(key);
                if (key.equalsIgnoreCase(productCategory)) {
                    return Integer.valueOf(value);
                }
            }
        }
        return 0;
    }

    @NacosValue(value = "${product.home.online.version.code:1}", autoRefreshed = true)
    private Integer defaultOnlineVersionCode;

    public Integer getDefaultOnlineVersionCode() {
        return defaultOnlineVersionCode;
    }

    @NacosValue(value = "${product.home.online.app.list:}", autoRefreshed = true)
    private String defaultOnlineAppList;

    public Boolean getDefaultOnlineAppList(String productCategory) {
        if (!StringUtils.isEmpty(defaultOnlineAppList)) {
            return defaultOnlineAppList.contains(productCategory);
        }
        return false;
    }
}
